﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace GUI.UsersControls
{
    public partial class UcMessageErreur : UserControl
    {
        public UcMessageErreur()
        {
            InitializeComponent();
            Visible = false;
        }

        public void afficher(String text, bool erreur, int temps = 6000)
        {
            Visible = true;
            theLabel.Text = text;
            BackColor = erreur ? Color.Maroon : Color.DarkGreen;
            theTimer.Interval = temps;
            theTimer.Start();
        }

        public void cacher()
        {
            Visible = false;
        }

        private void theTimer_Tick(object sender, EventArgs e)
        {
            theTimer.Stop();
            cacher();
        }
    }
}
